<?php
namespace app\common\model;

class ConfigGroupModel extends BaseModel
{
    protected $name = 'config_group';
    protected $pk='id';
    //开启自动写入时间戳
    protected $autoWriteTimestamp = false;

    /**
     * 删除分组
     * @param $id
     */
    public function delData($id){
        $info = ConfigModel::where('group_id',$id)->find();
        if($info) exception('分组下存在对应配置，不允许删除!',40001);
        $this->where('id',$id)->delete();
    }
}